// pages/test/test.ts
Page({

  /**
   * 页面的初始数据
   */
  data: {
    positionOption: ['大陆', '长沙', '株洲', '上海'],
    mytime: '2000-12-12',
    activeIndex: 0,
    activeLeft: 0,
    logsType: ['发现', '徒步', '完了', '酒店', '美食', '周边'],
    topIcon: true,
    isGoBotton: false,
    logspages: 1,
    logsItem: [
      {
        "systemType": "admin",
        "image": "https://dimg04.c-ctrip.com/images/1me3412000ejv9ss58CAB_R_640_10000_Q90.jpg",
        "images": ["https://dimg04.c-ctrip.com/images/1me3412000ejv9ss58CAB_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me7112000eivkdq7C735_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me1e12000enkgcg82060_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me6b12000em9scez5192_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me5912000ejbztxgE3D7_R_640_10000_Q90.jpg"],
        "type": "images",
        "position": "上海陆家嘴万信R酒店",
        "titile": "在上海住到了宝藏酒店！太舒服了😌",
        "admin": { "fontcolor": "#ae6e15", "color": "#fdefd2", "logo": "https://dimg04.c-ctrip.com/images/0AS64120009k1ouumABBE.png", "logoText": "https://dimg04.c-ctrip.com/images/0AS2z120009k1p6py8436.png", "bgImage": "https://dimg04.c-ctrip.com/images/0AS4u120009k1p2p9C257.png", "title": "4亿旅行者的口碑之选" },
        "userinfo": {}
      },
      {
        "systemType": "user",
        "image": "https://dimg04.c-ctrip.com/images/1me7112000eivkdq7C735_R_640_10000_Q90.jpg",
        "images": ["https://dimg04.c-ctrip.com/images/1me3412000ejv9ss58CAB_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me7112000eivkdq7C735_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me1e12000enkgcg82060_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me6b12000em9scez5192_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me5912000ejbztxgE3D7_R_640_10000_Q90.jpg"],
        "type": "Video",
        "position": "上海陆家嘴万信R酒店",
        "titile": "上海本地人推荐住的一家 外滩高颜值酒店！",
        "admin": {},
        "userinfo": { "userImage": "https://dimg04.c-ctrip.com/images/0Z80m12000dz4wiyi2D0D_C_180_180.jpg", "username": "星仔体验酒店", "goods": "115" }
      },
      {
        "systemType": "user",
        "image": "https://dimg04.c-ctrip.com/images/1me1e12000enkgcg82060_R_640_10000_Q90.jpg",
        "images": ["https://dimg04.c-ctrip.com/images/1me3412000ejv9ss58CAB_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me7112000eivkdq7C735_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me1e12000enkgcg82060_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me6b12000em9scez5192_R_640_10000_Q90.jpg", "https://dimg04.c-ctrip.com/images/1me5912000ejbztxgE3D7_R_640_10000_Q90.jpg"],
        "type": "images",
        "position": "人名广场",
        "titile": "哇哦！来上海一定要做的 N件事！",
        "admin": {},
        "userinfo": { "userImage": "https://dimg04.c-ctrip.com/images/1n70212000e70dopkA879_C_180_180.jpg", "username": "灵越旅行记", "goods": "2" }
      },
      {
        "systemType": "admin",
        "image": "https://dimg04.c-ctrip.com/images/1me3412000ejv9ss58CAB_R_640_10000_Q90.jpg",
        "images": [
          "https://dimg04.c-ctrip.com/images/1me3412000ejv9ss58CAB_R_640_10000_Q90.jpg",
          "https://dimg04.c-ctrip.com/images/1me7112000eivkdq7C735_R_640_10000_Q90.jpg",
          "https://dimg04.c-ctrip.com/images/1me1e12000enkgcg82060_R_640_10000_Q90.jpg",
          "https://dimg04.c-ctrip.com/images/1me6b12000em9scez5192_R_640_10000_Q90.jpg"
        ],
        "type": "images",
        "position": "上海陆家嘴万信R酒店",
        "titile": "在上海住到了宝藏酒店！太舒服了😌",
        "admin": { "fontcolor": "red", "color": "pink", "logo": "https://dimg04.c-ctrip.com/images/0AS4n120009eainsc98AB.png", "logoText": "https://dimg04.c-ctrip.com/images/0AS6m120009eaj47c0D49.png", "bgImage": "https://dimg04.c-ctrip.com/images/0AS4p120009eair3bE29D.png", "title": "特价好货低价抢" },
        "userinfo": {}
      },
      {
        "systemType": "user",
        "image": "https://dimg04.c-ctrip.com/images/1me6b12000em9scez5192_R_640_10000_Q90.jpg",
        "type": "images",
        "position": "外滩",
        "titile": "上海city walk精华路线📍就问你city不city啊",
        "admin": {},
        "userinfo": { "userImage": "https://dimg04.c-ctrip.com/images/0Z82u12000cxqzhcjBF58_C_180_180.jpg", "username": "菠萝加个蜜", "goods": "17" }
      },
      {
        "systemType": "user",
        "image": "https://dimg04.c-ctrip.com/images/1me2j12000ejwphb1ED8A_R_640_10000_Q90.jpg",
        "type": "images",
        "position": "磁浮列车",
        "titile": "世界上最快的列车在中国 上海磁悬浮列车",
        "admin": {},
        "userinfo": { "userImage": "https://dimg04.c-ctrip.com/images/0Z85r12000djsh57o6234_C_180_180.jpg", "username": "环游世界的彩霞", "goods": "24" }
      },
      {
        "systemType": "admin",
        "image": "https://dimg04.c-ctrip.com/images/1me4612000el2avqn6044_R_640_10000_Q90.jpg",
        "type": "images",
        "position": "上海玩具总动员酒店",
        "titile": "想带娃去上海不知道去哪玩？收藏这条就够啦！",
        "admin": { "fontcolor": "red", "color": "pink", "logo": "https://dimg04.c-ctrip.com/images/0AS4n120009eainsc98AB.png", "logoText": "https://dimg04.c-ctrip.com/images/0AS6m120009eaj47c0D49.png", "bgImage": "https://dimg04.c-ctrip.com/images/0AS4p120009eair3bE29D.png", "title": "特价好货低价抢" },
        "userinfo": {}
      },
      {
        "systemType": "admin",
        "image": "https://dimg04.c-ctrip.com/images/1me4612000el2avqn6044_R_640_10000_Q90.jpg",
        "type": "images",
        "position": "上海玩具总动员酒店",
        "titile": "想带娃去上海不知道去哪玩？收藏这条就够啦！",
        "admin": { "fontcolor": "red", "color": "pink", "logo": "https://dimg04.c-ctrip.com/images/0AS4n120009eainsc98AB.png", "logoText": "https://dimg04.c-ctrip.com/images/0AS6m120009eaj47c0D49.png", "bgImage": "https://dimg04.c-ctrip.com/images/0AS4p120009eair3bE29D.png", "title": "特价好货低价抢" },
        "userinfo": {}
      },
      {
        "systemType": "user",
        "image": "https://dimg04.c-ctrip.com/images/1me1k12000elzaytj5ACD_R_640_10000_Q90.jpg",
        "type": "Video",
        "position": "上海陆家嘴万信R酒店",
        "titile": "在上海住到了宝藏酒店！太舒服了😌",
        "admin": {},
        "userinfo": { "userImage": "https://dimg04.c-ctrip.com/images/0Z80m12000dz4wiyi2D0D_C_180_180.jpg", "username": "星仔体验酒店", "goods": "1984" }
      },
      {
        "systemType": "admin",
        "image": "https://dimg04.c-ctrip.com/images/1me5m12000elz59zaB78B_R_640_10000_Q90.jpg",
        "type": "play",
        "position": "南浦大桥",
        "titile": "#亚洲第一 世界第三的斜拉索大桥 #旅行推荐官 #旅行",
        "admin": { "fontcolor": "#1c8debe0", "color": "skyblue", "logo": "https://dimg04.c-ctrip.com/images/0AS2b120009eaj4qkFDA1.png", "logoText": "https://dimg04.c-ctrip.com/images/0AS56120009eaj7zs183E.png", "bgImage": "https://dimg04.c-ctrip.com/images/0AS2v120009eainsa328F.png", "title": "特价好货低价抢" },
        "userinfo": {}
      },
      {
        "systemType": "admin",
        "image": "https://dimg04.c-ctrip.com/images/1me5912000ejbztxgE3D7_R_640_10000_Q90.jpg",
        "type": "Video",
        "position": "上海东锦江希尔顿逸林酒店",
        "titile": "上海酒店推荐",
        "admin": { "fontcolor": "#1c8debe0", "color": "skyblue", "logo": "https://dimg04.c-ctrip.com/images/0AS2b120009eaj4qkFDA1.png", "logoText": "https://dimg04.c-ctrip.com/images/0AS56120009eaj7zs183E.png", "bgImage": "https://dimg04.c-ctrip.com/images/0AS2v120009eainsa328F.png", "title": "特价好货低价抢" },
        "userinfo": {}
      }
    ]
  },
  bindTimeChange: function () {

  },
  active(e: any) {
    let activeLeft = 0;
    if (e.currentTarget.dataset.index >= this.data.logsType.length / 2) activeLeft = 160;
    this.setData({
      activeIndex: e.currentTarget.dataset.index,
      activeLeft
    });
  },
  clickIcon() {
    this.setData({
      topIcon: !this.data.topIcon
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
    if (!this.data.isGoBotton) {
      let pageindex = this.data.logspages;
      wx.showLoading({
        title: '正在加载'
      });
      setTimeout(() => {
        if (pageindex * 4 >= this.data.logsItem.length) {
          wx.showModal({
            title: "提示",
            content: "已经没有更多内容了",
            showCancel: false
          });
          this.setData({
            isGoBotton: true
          })
        } else {
          this.setData({
            logspages: pageindex + 1,
          });
        }
        wx.hideLoading();
      }, 1000);
    }
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})